//Source file: D:\\test\\com\\ce\\pms\\charge\\model\\VoucherDomain.java

package com.ce.pms.charge.model;

import java.math.BigDecimal;
import java.util.Date;
import java.util.Set;

import javax.persistence.*;

import com.ce.pms.common.model.SysInfo;
import com.ce.pms.customer.model.ProRightDO;
import com.ce.pms.house.model.HouseDomain;
import com.sitechasia.webx.core.model.IDomainObject;

/**
 * 实体名称:凭证 关联数据表:FEE_VOUCHER
 * @author yandawei
 * @CreateDate:2008-7-14
 */
@Entity
@Table(name = "FEE_VOUCHER")
public class VoucherDomain implements IDomainObject{

	/**
	 * 主键
	 */
	@Id
	@GeneratedValue
	@Column(name = "VOUCHER_ID")
	private Long voucherId;

	/**
	 * 房屋
	 */
	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "HOUSE_ID",nullable=false)
	private HouseDomain house;

	/**
	 * 产权
	 */
	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "PRO_RIGHT_ID",nullable=false)
	private ProRightDO proRight;

	/**
	 * 凭证号码
	 */
	@Column(name = "VOUCHER_NUM", length = 30)
	private String voucherNumber;

	/**
	 * 发生金额
	 */
	@Column(name = "SUM", precision = 18, scale = 2)
	private BigDecimal sum = new BigDecimal("0.00");

	/**
	 * 收费日期
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CHARGE_DATE")
	private Date chargeDate;

	/**
	 * 打印次数
	 */
	@Column(name = "PRINT_TIMES")
	private Short printTimes;

	/**
	 * 凭证状态:001 新建;002已打印;003作废
	 */
	@Column(name = "STATUZ", length = 3, nullable = false)
	private String statuz;

	/**
	 * 关联交易集
	 */
	@OneToMany(mappedBy="voucher")
	private Set<CreditTransDomain> transactions;

	/**
	 * 系统信息
	 */
	@Embedded
	private SysInfo sysInfo;

	/**
	 * @roseuid 48757D1800FA
	 */
	public VoucherDomain() {

	}
	/**
	 * mini constructor
	 * @param house    房屋
	 * @param proRight 产权
	 * @param statuz   凭证状态:001 新建;002已打印;003作废
	 * @param sysInfo  系统信息
	 */
	public VoucherDomain(HouseDomain house, ProRightDO proRight, String statuz, SysInfo sysInfo) {
		super();
		this.house = house;
		this.proRight = proRight;
		this.statuz = statuz;
		this.sysInfo = sysInfo;
	}

	public Date getChargeDate() {
		return chargeDate;
	}

	public void setChargeDate(Date chargeDate) {
		this.chargeDate = chargeDate;
	}

	public HouseDomain getHouse() {
		return house;
	}

	public void setHouse(HouseDomain house) {
		this.house = house;
	}

	public Short getPrintTimes() {
		return printTimes;
	}

	public void setPrintTimes(Short printTimes) {
		this.printTimes = printTimes;
	}

	public ProRightDO getProRight() {
		return proRight;
	}

	public void setProRight(ProRightDO proRight) {
		this.proRight = proRight;
	}

	public String getStatuz() {
		return statuz;
	}

	public void setStatuz(String statuz) {
		this.statuz = statuz;
	}

	public BigDecimal getSum() {
		return sum;
	}

	public void setSum(BigDecimal sum) {
		this.sum = sum;
	}

	public SysInfo getSysInfo() {
		return sysInfo;
	}

	public void setSysInfo(SysInfo sysInfo) {
		this.sysInfo = sysInfo;
	}

	public Set<CreditTransDomain> getTransactions() {
		return transactions;
	}

	public void setTransactions(Set<CreditTransDomain> transactions) {
		this.transactions = transactions;
	}

	public Long getVoucherId() {
		return voucherId;
	}

	public void setVoucherId(Long voucherId) {
		this.voucherId = voucherId;
	}

	public String getVoucherNumber() {
		return voucherNumber;
	}

	public void setVoucherNumber(String voucherNumber) {
		this.voucherNumber = voucherNumber;
	}

}
